﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace IFTRUE.EIMS.Web.Ashx
{
    /// <summary>
    /// LogManage 的摘要说明
    /// </summary>
    public class LogManage : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            //安全验证
            string strMsg = "";
            if (!AshxCheck.Check(context, ref strMsg))
            {
                context.Response.Write(SysMsg.GetCommonMsg(strMsg));
                return;
            }

            //删除
            if (context.Request["type"] == "delete")
            {
                string strId = context.Request["ids"];
                if (!string.IsNullOrEmpty(strId))
                {
                    BLL.Log logBLL = new BLL.Log();
                    string []strIds = strId.Split(',');
                    foreach (string s in strIds)
                    {
                        logBLL.Delete(s);
                    }
                }
                context.Response.Write(SysMsg.GetSuccessMsg("LogManage", "forward"));
            }

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}